// 列表loading
function showLoading(cla, mode) {
  if (mode === "table") {
    $(cla).append(
      `<tr id="loading-overlay"><td class="loading-content"></td></tr> `
    );
  } else {
    // $(cla).append(`<div id="loading-overlay"><div class="loading-content"></div ></div > `);
   
    if (cla !== "#btob_content") {
      $(cla).append(
        `<div  class="restPageListContent" id="restPageListContent">
      <div class="bg_container">
        <div class="item" lid="o" saving="">
          <div class="top_msg">
            <div class="left_msg selector">
              <input type="checkbox" name="select" />
            </div>
            <div class="right_msg">
              <div class="name placeHolderShimmer">
                <a href="javascript:;" rel="nofollow">---</a>
              </div>
              <div class="tips placeHolderShimmer">
                <span
                  ><span class="i_out"><i class="icon_flag_middle"></i></span
                  >---</span
                >
              </div>
            </div>
          </div>
          <div class="clear"></div>
          <div class="bottom_msg">
            <div class="new_box">
              <div class="right_box placeHolderShimmer">
                <span class="sec_copy"
                  ><span class="sec_name">{:__('交易产品')}：</span>
                  <span class="sec_value arial">---</span></span
                >
                <span class="sec_copy"
                  ><span class="sec_name">{:__('HS编码')}：</span>
                  <span class="sec_value">---</span></span
                >
                <span class="sec_copy"
                  ><span class="sec_name">{:__('HS编码')}：</span>
                  <span class="sec_value">---</span></span
                >
              </div>
              <div class="word blod placeHolderShimmer">
                <span class="is_show">---</span>
                <div><span>---</span></div>
              </div>
              <div class="btn">
                <a class="collect2 detail_url" href="javascript:;">---</a>
                <a class="collect2 save_btn" href="javascript:;">---</a>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="bg_container">
        <div class="item" lid="o" saving="">
          <div class="top_msg">
            <div class="left_msg selector">
              <input type="checkbox" name="select" />
            </div>
            <div class="right_msg">
              <div class="name placeHolderShimmer">
                <a href="javascript:;" rel="nofollow">---</a>
              </div>
              <div class="tips placeHolderShimmer">
                <span
                  ><span class="i_out"><i class="icon_flag_middle"></i></span
                  >---</span
                >
              </div>
            </div>
          </div>
          <div class="clear"></div>
          <div class="bottom_msg">
            <div class="new_box">
              <div class="right_box placeHolderShimmer">
                <span class="sec_copy"
                  ><span class="sec_name">{:__('交易产品')}：</span>
                  <span class="sec_value arial">---</span></span
                >
                <span class="sec_copy"
                  ><span class="sec_name">{:__('HS编码')}：</span>
                  <span class="sec_value">---</span></span
                >
                <span class="sec_copy"
                  ><span class="sec_name">{:__('HS编码')}：</span>
                  <span class="sec_value">---</span></span
                >
              </div>
              <div class="word blod placeHolderShimmer">
                <span class="is_show">---</span>
                <div><span>---</span></div>
              </div>
              <div class="btn">
                <a class="collect2 detail_url" href="javascript:;">---</a>
                <a class="collect2 save_btn" href="javascript:;">---</a>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="bg_container">
        <div class="item" lid="o" saving="">
          <div class="top_msg">
            <div class="left_msg selector">
              <input type="checkbox" name="select" />
            </div>
            <div class="right_msg">
              <div class="name placeHolderShimmer">
                <a href="javascript:;" rel="nofollow">---</a>
              </div>
              <div class="tips placeHolderShimmer">
                <span
                  ><span class="i_out"><i class="icon_flag_middle"></i></span
                  >---</span
                >
              </div>
            </div>
          </div>
          <div class="clear"></div>
          <div class="bottom_msg">
            <div class="new_box">
              <div class="right_box placeHolderShimmer">
                <span class="sec_copy"
                  ><span class="sec_name">{:__('交易产品')}：</span>
                  <span class="sec_value arial">---</span></span
                >
                <span class="sec_copy"
                  ><span class="sec_name">{:__('HS编码')}：</span>
                  <span class="sec_value">---</span></span
                >
                <span class="sec_copy"
                  ><span class="sec_name">{:__('HS编码')}：</span>
                  <span class="sec_value">---</span></span
                >
              </div>
              <div class="word blod placeHolderShimmer">
                <span class="is_show">---</span>
                <div><span>---</span></div>
              </div>
              <div class="btn">
                <a class="collect2 detail_url" href="javascript:;">---</a>
                <a class="collect2 save_btn" href="javascript:;">---</a>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div> `
      );
    } else {
      $(cla).append(
        `<div class="restPageListContent" id="restPageListContent">
                <div class="bg_container" style="margin-top: 10px">
                  <div class="item" lid="o" saving="" style="display: flex">
                    <div
                      class="top_msg"
                      style="display: flex; flex: 1; margin-right: 100px"
                    >
                      <div class="left_msg selector">
                        <input type="checkbox" name="select" />
                      </div>
                      <div class="right_msg" style="margin-left: 10px; flex: 1">
                        <div
                          class="name placeHolderShimmer"
                          style="height: 30px"
                        >
                          <a href="javascript:;" rel="nofollow">---</a>
                        </div>
                        <div
                          class="name placeHolderShimmer"
                          style="height: 70px; margin-top: 8px"
                        >
                          <a href="javascript:;" rel="nofollow">---</a>
                        </div>
                      </div>
                    </div>
                    <div class="clear"></div>
                    <div class="bottom_msg" style="height: 108px">
                      <div class="new_box" style="height: 100%; padding: 0">
                        <div
                          class="right_box placeHolderShimmer"
                          style="height: 100%;width: 100%"
                        >
                          <span class="sec_copy"
                            ><span class="sec_name">{:__('交易产品')}：</span>
                            <span class="sec_value arial">---</span></span
                          >
                          <span class="sec_copy"
                            ><span class="sec_name">{:__('HS编码')}：</span>
                            <span class="sec_value">---</span></span
                          >
                          <span class="sec_copy"
                            ><span class="sec_name">{:__('HS编码')}：</span>
                            <span class="sec_value">---</span></span
                          >
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
                <div class="bg_container" style="margin-top: 10px">
                  <div class="item" lid="o" saving="" style="display: flex">
                    <div
                      class="top_msg"
                      style="display: flex; flex: 1; margin-right: 100px"
                    >
                      <div class="left_msg selector">
                        <input type="checkbox" name="select" />
                      </div>
                      <div class="right_msg" style="margin-left: 10px; flex: 1">
                        <div
                          class="name placeHolderShimmer"
                          style="height: 30px"
                        >
                          <a href="javascript:;" rel="nofollow">---</a>
                        </div>
                        <div
                          class="name placeHolderShimmer"
                          style="height: 70px; margin-top: 8px"
                        >
                          <a href="javascript:;" rel="nofollow">---</a>
                        </div>
                      </div>
                    </div>
                    <div class="clear"></div>
                    <div class="bottom_msg" style="height: 108px">
                      <div class="new_box" style="height: 100%;padding: 0">
                        <div
                          class="right_box placeHolderShimmer"
                          style="height: 100%;width: 100%"
                        >
                          <span class="sec_copy"
                            ><span class="sec_name">{:__('交易产品')}：</span>
                            <span class="sec_value arial">---</span></span
                          >
                          <span class="sec_copy"
                            ><span class="sec_name">{:__('HS编码')}：</span>
                            <span class="sec_value">---</span></span
                          >
                          <span class="sec_copy"
                            ><span class="sec_name">{:__('HS编码')}：</span>
                            <span class="sec_value">---</span></span
                          >
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
                <div class="bg_container" style="margin-top: 10px">
                  <div class="item" lid="o" saving="" style="display: flex">
                    <div
                      class="top_msg"
                      style="display: flex; flex: 1; margin-right: 100px"
                    >
                      <div class="left_msg selector">
                        <input type="checkbox" name="select" />
                      </div>
                      <div class="right_msg" style="margin-left: 10px; flex: 1">
                        <div
                          class="name placeHolderShimmer"
                          style="height: 30px"
                        >
                          <a href="javascript:;" rel="nofollow">---</a>
                        </div>
                        <div
                          class="name placeHolderShimmer"
                          style="height: 70px; margin-top: 8px"
                        >
                          <a href="javascript:;" rel="nofollow">---</a>
                        </div>
                      </div>
                    </div>
                    <div class="clear"></div>
                    <div class="bottom_msg" style="height: 108px">
                      <div class="new_box" style="height: 100%;padding: 0;margin:0">
                        <div
                          class="right_box placeHolderShimmer"
                          style="height: 100%;width: 100%"
                        >
                          <span class="sec_copy"
                            ><span class="sec_name">{:__('交易产品')}：</span>
                            <span class="sec_value arial">---</span></span
                          >
                          <span class="sec_copy"
                            ><span class="sec_name">{:__('HS编码')}：</span>
                            <span class="sec_value">---</span></span
                          >
                          <span class="sec_copy"
                            ><span class="sec_name">{:__('HS编码')}：</span>
                            <span class="sec_value">---</span></span
                          >
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div> `
      );
    }
  }

  $("#loading-overlay").fadeIn(200);
}

function hideLoading(mode) {
  $("#loading-overlay, #restPageListContent").fadeOut(200, function () {
    $(this).remove();
  });
  // if (mode === "table") {
  //   $("#loading-overlay").fadeOut(200, function () {
  //     $(this).remove();
  //   });
  // } else {
  //   $("#restPageListContent").fadeOut(200, function () {
  //     $(this).remove();
  //   });
  // }
}

// 详情loading
function noConntenLoading(cla, hgt) {
  $(cla).append(`<div id="no-con-loading" style="height: ${
    hgt || 100
  }px" class="no-con-loading">
    <div class="no-loading-content">
      <i class="icon"></i>
      <span class="text">AI小琨正在为您生成数据中</span>
      <i class="loaing-icon"></i>
    </div >
    </div > `);
  $("#no-con-loading").fadeIn(200);
}

function hideNoConntenLoading(cla) {
  $("#no-con-loading").fadeOut(200, function () {
    $(this).remove();
  });
  
}

// 详情右边小模块列表loading
function rightSmallModuleLoading(cla, hgt) {
  $(cla).append(`<div id="small-module-loading" style="height: ${
    hgt || 100
  }px" class="small-module-loading">
    <div class="small-module-content">
      <i class="icon"></i>
    </div >
    </div > `);
  $("#small-module-loading").fadeIn(200);
}

function hideRightSmallModuleLoading() {
  $("#small-module-loading").fadeOut(200, function () {
    $(this).remove();
  });
}

// 联系方式loading
function contactInformationLoading(cla, hgt) {
  $(cla).append(`<div id="contact-information-loading" style="height: ${
    hgt || 100
  }px" class="contact-information-loading">
    <div class="contact-information-content">
      <p class="text">AI小琨正在为您匹配信息...</p>
      <div class="img-box">
        <i class="phone"></i>
        <i class="email"></i>
        <i class="contact"></i>
      </div>
    </div >
    </div > `);
  $("#contact-information-loading").fadeIn(200);
}

function hideContactInformationLoading(cla) {
  $("#contact-information-loading").fadeOut(200, function () {
    $(this).remove();
  });
}
